/**
 * @FileName: KnowledgeExceptions.java
 * @Package: com.ziroom.zmc.services.knowledge.exception
 * @author youshipeng
 * @created 2016/11/14 16:23
 * <p>
 * Copyright 2016 ziroom
 */
package top.swimmer.core.exception;

import top.swimmer.tools.exception.ExceptionDef;
import top.swimmer.tools.exception.ExceptionProxy;

/**
 * <p></p>
 *
 * <PRE>
 * <BR>	修改记录
 * <BR>-----------------------------------------------
 * <BR>	修改日期			修改人			修改内容
 * </PRE>
 *
 * @author youshipeng
 * @since 1.0
 * @version 1.0
 */
public interface WindstormExceptions {
    WindstormExceptions INSTANCE = ExceptionProxy.newProxyInstance(WindstormExceptions.class);

    @ExceptionDef(code = 404, message = "{0} [{1}] not found.")
    WindstormException notFound(String entity, Integer id);

    @ExceptionDef(code = 404, message = "{0} [{2}]'s {1} not found.")
    WindstormException notFound(String hostEntity, String entity, Integer id);

    @ExceptionDef(code = 500, message = "Failed to create [{0}] entity.")
    WindstormException createFailed(String entity);

    @ExceptionDef(code = 500, message = "Failed to update [{0}] entity [{1}].")
    WindstormException updateFailed(String entity, Integer id);

    @ExceptionDef(code = 500, message = "Failed to delete [{0}] entity [{1}].")
    WindstormException deleteFailed(String entity, Integer id);

    @ExceptionDef(code = 500, message = "Failed to query entity.")
    WindstormException queryFailed();

    @ExceptionDef(code = 500, message = "Failed to soft delete [{0}] entity [{1}].")
    WindstormException softDeleteFailed(String entity, Integer id);
}